package com.liu.controller;

import com.liu.bean.User;
import com.liu.remote.UserRemoteClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class PurchaseController {
    @Autowired
    UserRemoteClient userRemoteClient;

    @GetMapping("/purchase")
    public Map get(int id){
        Map map = new HashMap<>();
        map.put("id",1);
        map.put("name","adf");
        User user = userRemoteClient.get(1);
        map.put("user",user);
        return map;

    }

}
